import { makeAutoObservable } from 'mobx';
import { RolePermission, UserRole } from './interface.ts';
import { ENUM_POLICY_ACTION, ROLE_TYPE } from '../config/enum.ts';

export class RoleEntity implements UserRole {
  _id = '';
  name = '';
  description = '';
  isActive = false;
  type = ROLE_TYPE.USER;
  permissions: RolePermission[] = [
    {
      subject: 'API_KEY',
      action: [ENUM_POLICY_ACTION.CREATE, ENUM_POLICY_ACTION.DELETE],
    },
  ];
  permissions_num = 0;
  createdAt = '';
  updatedAt = '';

  constructor() {
    makeAutoObservable(this);
  }
}
